/***********************************************************************/
/*                                                                     */
/*  FILE        :initsct.h                                             */
/*  DATE        :Thu, May 13, 2010                                     */
/*  DESCRIPTION :define the macro for initialization of sections.      */
/*  CPU GROUP   :62P                                                   */
/*                                                                     */
/*  This file is generated by Renesas Project Generator (Ver.4.17).    */
/*                                                                     */
/***********************************************************************/
/*********************************************************************
*
* Device     : M16C/60,30,20,10
*
* File Name  : initsct.h
*
* Abstract   : Define the macro for initialization of sections.
*              (note: Do not modify)
*
* History    : 1.90  (2009-01-27)
*
* Copyright(c) 2009 Renesas Technology Corp.
*               And Renesas Solutions Corp.,All Rights Reserved. 
*
*********************************************************************/
#include "cstartdef.h"

#pragma section program interrupt
#define	sclear(X,Y,Z)	_asm("	.initsct "X","Y","Z"\n"\
			"	mov.b	#00H,R0L\n"\
			"	mov.w	#(topof	"X") ,A1\n"\
			"	mov.w	#sizeof	"X",R3\n"\
			"	sstr.b")

#define sclear_f(X,Y,Z)	_asm("	.initsct "X","Y","Z"\n"\
			"	push.w	#(sizeof "X")>>16\n"\
			"	push.w	#(sizeof "X")&0ffffH\n"\
			"	push.w	#(topof "X")>>16\n"\
			"	push.w	#(topof "X")&0ffffH\n"\
			"	.stk	8\n"\
			"	.glb	_bzero\n"\
			"	.call	_bzero,G\n"\
			"	jsr.a	_bzero\n"\
			"	add.b	#8H,sp\n"\
			"	.stk	-8")


#define scopy(X,Y,Z)	_asm("	.initsct "X","Y","Z"\n"\
			"	.initsct "X"I,rom"Y",noalign\n"\
			"	mov.w	#(topof "X"I)&0ffffH,A0\n"\
			"	mov.b	#(topof "X"I)>>16,R1H\n"\
			"	mov.w	#(topof "X")&0ffffH,A1\n"\
			"	mov.w	#sizeof	"X",R3\n"\
			"	smovf.b")

#define	scopy_f(X,Y,Z)	_asm("	.initsct "X","Y","Z"\n"\
			"	.initsct "X"I,rom"Y",noalign\n"\
			"	push.w	#(sizeof "X") >> 16\n"\
			"	push.w	#(sizeof "X") & 0ffffH\n"\
			"	push.w	#(topof "X") >> 16\n"\
			"	push.w	#(topof "X") & 0ffffH\n"\
			"	push.w	#(topof "X"I) >> 16\n"\
			"	push.w	#(topof "X"I) & 0ffffH\n"\
			"	.stk	12\n"\
			"	.glb	_bcopy\n"\
			"	.call	_bcopy,G\n"\
			"	jsr.a	_bcopy\n"\
			"	add.b	#12,sp\n"\
			"	.stk	-12")

